package com.uam.core.lk.utils.thread;

import java.util.Calendar;

/**
 * @author 祝展
 * @version 1.0
 * @description
 * @Date 2020/4/30 09:08
 **/
public class ThreadLocalCalendar {

    private static final ThreadLocal<Calendar> threadCalendar = new ThreadLocal<Calendar>(){
        @Override
        protected Calendar initialValue(){
            Calendar calendar = Calendar.getInstance();
            return calendar;
        }
    };

    public static Calendar getInstance(){
        return threadCalendar.get();
    }

    public static void main(String[] args) {
        Calendar calendar = ThreadLocalCalendar.getInstance();
        System.out.println(calendar.getTime().getTime());
        System.out.println();
    }
}
